package com.hskn.hss.module.tlresplanitem.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hskn.hss.entity.AjaxResult;
import com.hskn.hss.exception.HssException;
import com.hskn.hss.module.tlresplanitem.entity.TlEmergentResplanItem;
import com.hskn.hss.module.tlresplanitem.mapper.TlEmergentResplanItemMapper;
import com.hskn.hss.module.tlresplanitem.service.ITlEmergentResplanItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author hskn
 * @since 2021-05-18
 */
@Service
public class TlEmergentResplanItemServiceImpl extends ServiceImpl<TlEmergentResplanItemMapper, TlEmergentResplanItem> implements ITlEmergentResplanItemService {
    @Autowired
    TlEmergentResplanItemMapper tlEmergentResplanItemMapper;

    @Override
    public AjaxResult insert(TlEmergentResplanItem tlEmergentResplanItem) throws HssException {
//        TlEmergentResplanItem tlEmergentResplanItem = params.getObject("data" , TlEmergentResplanItem.class );
        tlEmergentResplanItemMapper.insert(tlEmergentResplanItem);
        return AjaxResult.success("操作成功");
    }

    @Override
    public AjaxResult deletebyid(String resplanid) throws HssException {
        Map map = new HashMap<>();
        map.put("resplanid", resplanid);
        tlEmergentResplanItemMapper.deleteByMap(map);
        return AjaxResult.success("操作成功");
    }
}
